package org.example.jdk8;

public class test6 {
    public static void main(String[] args) {
        Myclass2 myClass = new Myclass2();
        myClass.display();
    }

}

interface MyInterface {
    default void display() {
        System.out.println("Hello World!");
    }
}
interface MyInterface1 {
    default void display() {
        System.out.println("Hello World! 111");
    }
}

class MyClass implements MyInterface,MyInterface1 {
    /*
    * 实现两个以上的接口，需要重写两个以上接口的display方法
    * */
    public void display() {
        MyInterface.super.display();
    }
}

class Myclass1 implements MyInterface{
    @Override
    public void display() {
        System.out.println("Myclass1");
    }
}
/*
*   类优先级大于接口
*   display输出 Myclass1
* */
class Myclass2 extends Myclass1 implements MyInterface1{}